﻿#region using statements

using System;

using Microsoft.Xna.Framework;

using NGen;
using NGen.Managers.GUI;

using Nuclex.UserInterface;
using Nuclex.UserInterface.Controls;

#endregion

namespace TowerDefense.GUILayouts
{
	public class GUIElementCreditsWindow : GUIElement
	{
		private readonly LabelControl m_label = new LabelControl();

		private readonly WindowWithOkButtonControl m_window = new WindowWithOkButtonControl();

		protected override void _Cleanup() {}

		protected override void _Initialize() {
			m_window.Bounds = new UniRectangle(new UniScalar(0.125f, 0), new UniScalar(0.075f, 0.0f), 600, 500);
			m_window.OkButton.Pressed += _OkButtonClick;
			m_window.OkButton.Bounds = new UniRectangle(new UniScalar(0.5f, -37.5f), new UniScalar(0.85f, 0.0f), new UniScalar(75.0f), new UniScalar(35.0f));
			m_window.Title = "Credits";

			m_label.Bounds = new UniRectangle(new UniScalar(0.1f, 0), new UniScalar(0.2f, 0), 0, 0);
			m_label.Text = "This game was developed as a sample project for the following book:\n\n" + "Algorithmic and Architectural Game Gesign: Implementation and Development\n\n\n";
			m_label.Text += "Book Editors:\n     Dr. Ashok Kumar\n     Dr. Jim Etheredge\n     Hollie Boudreaux\n\n";
			m_label.Text += "This software was developed by: \n    Brandon Primeaux\n    Hollie Boudreaux";

			m_window.Children.Add(m_label);
			_Children.Add(m_window);
		}

		protected override void Update(GameTime p_gameTime) {}

		protected virtual void _OkButtonClick(object p_sender, EventArgs p_e) {
			GameEngine.GetService<IManagerGUI>().RemoveElement(this);
		}
	}
}